function theta2 = setTheta2(h0,hx,sigma)
nx = size(hx,1);
if nx == 2
    theta2.h01      = h0(1,1);
    theta2.h02      = h0(2,1);
    theta2.hx11     = hx(1,1);
    theta2.hx12     = hx(1,2);
    theta2.hx21     = hx(2,1);
    theta2.hx22     = hx(2,2);
    theta2.sigma11  = sigma(1,1);
    theta2.sigma21  = sigma(2,1);
    theta2.sigma22  = sigma(2,2);
elseif nx == 3
    theta2.h01      = h0(1,1);
    theta2.h02      = h0(2,1);
    theta2.h03      = h0(3,1);
    theta2.hx11     = hx(1,1);
    theta2.hx12     = hx(1,2);
    theta2.hx13     = hx(1,3);
    theta2.hx21     = hx(2,1);
    theta2.hx22     = hx(2,2);
    theta2.hx23     = hx(2,3);
    theta2.hx31     = hx(3,1);
    theta2.hx32     = hx(3,2);
    theta2.hx33     = hx(3,3);
    theta2.sigma11  = sigma(1,1);
    theta2.sigma21  = sigma(2,1);
    theta2.sigma22  = sigma(2,2);
    theta2.sigma31  = sigma(3,1);
    theta2.sigma32  = sigma(3,2);
    theta2.sigma33  = sigma(3,3);
elseif nx == 4
    theta2.h01      = h0(1,1);
    theta2.h02      = h0(2,1);
    theta2.h03      = h0(3,1);
    theta2.h04      = h0(4,1);
    theta2.hx11     = hx(1,1);
    theta2.hx12     = hx(1,2);
    theta2.hx13     = hx(1,3);
    theta2.hx14     = hx(1,4);
    theta2.hx21     = hx(2,1);
    theta2.hx22     = hx(2,2);
    theta2.hx23     = hx(2,3);
    theta2.hx24     = hx(2,4);
    theta2.hx31     = hx(3,1);
    theta2.hx32     = hx(3,2);
    theta2.hx33     = hx(3,3);
    theta2.hx34     = hx(3,4);
    theta2.hx41     = hx(4,1);
    theta2.hx42     = hx(4,2);
    theta2.hx43     = hx(4,3);
    theta2.hx44     = hx(4,4);
    theta2.sigma11  = sigma(1,1);
    theta2.sigma21  = sigma(2,1);
    theta2.sigma22  = sigma(2,2);
    theta2.sigma31  = sigma(3,1);
    theta2.sigma32  = sigma(3,2);
    theta2.sigma33  = sigma(3,3);
    theta2.sigma41  = sigma(4,1);
    theta2.sigma42  = sigma(4,2);
    theta2.sigma43  = sigma(4,3);
    theta2.sigma44  = sigma(4,4);
    
end